var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(e, c, b) {
    if (status == 0 && e == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.setNumberForQuestInfo(16625, "ark", 0);
            cm.setNumberForQuestInfo(100272, "end", 0);
            var d = cm.getNumberFromQuestInfo(100272, "lv");
            cm.setNumberForQuestInfo(100272, "jet", d >= 12 ? 5 : d >= 6 ? 3 : 0);
            cm.openUI(1183);
            cm.sendNewEffects(11, [0, 0, 0, 0, 0])
        } else {
            if (status === a++) {
                cm.sendNewEffects(13, [0, 0, 220, 0, 0]);
                cm.dispose()
            }
        }
    }
};